#!/bin/bash

touch step1/test.txt 
cd step1    
make >/dev/null 2>&1   


./main >test.txt       

cat test.txt

make clean >/dev/null 2>&1   

minNotesLen=100;
awk -v minNotesLen=$minNotesLen '{
  if(flag==1 && $NF!~"\\*/" ){
      content=content""$0      
    }
if($0~/problem-solving ideas:/){
   flag=1; 
   content=content""substr($0,index($0,"ideas:")+6)
   startLine=FNR;
}
if($NF~"\\*/"&&flag==1){
   endLine=FNR;
   content=content""substr($0,1,index($0,"*/")-1)
   gsub(" ","",content)
   len=length(content)
   if(len<minNotesLen&&flag==1){
       #printf("notes len:%d,from line %d to line:%d\n",len,startLine,endLine);
       print("请在problem-solving ideas:后写下详细的解题思路！");
}
flag=0;
}
}' main.c           